load("@fbsource//tools/build_defs:rust_binary.bzl", "rust_binary")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")
load(":bundled_cell.bzl", "bundled_cell")

oncall("build_infra")

bundled_cell(
    name = "prelude",
    include_from_file = "src/lib.rs",
    source_listing = "prelude//:source_listing",
)

rust_library(
    name = "buck2_external_cells_bundled",
    srcs = glob([
        "src/**/*.rs",
        "test_data/**/*",
        "test_data/**/.*",
    ]),
    mapped_srcs = {
        ":prelude": "src/prelude",
    },
    # Do not add non-third party deps. This should store the data only, so that
    # we avoid recompiling if at all possible.
    #
    # FIXME(JakobDegen): Ideally this would be a `rust_linkable_symbol`-like
    # thing, but that needs to be moved to the prelude after buck1-death. It
    # also can't be made to work with cargo builds, so we'd need to deprecate
    # those more too.
    deps = [],
)

rust_binary(
    name = "processor",
    srcs = ["processor.rs"],
)
